package com.java.demo7;

public class AnimalOperate {

    public void userCat(Cat cat) {
        cat.eat();

    }


    public void userDog(Dog dog) {
        dog.eat();

    }

    public void userAnimal() {
        //编译看左边，执行看右边

        Animal cat = new Cat();
        cat.eat();

        Animal dog = new Dog();
        dog.eat();


    }

    public void userAnimal(Animal animal) {
        animal.eat();
    }


}
